Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 4 - Dialog Manager Reference / Dialog Manager Types and Constants


The Standard Alert Structure

NEW WITH THE APPEARANCE MANAGER

A standard alert structure of type AlertStdAlertParamRec can be used when you call the function StandardAlert to customize the alert box.

struct AlertStdAlertParamRec {
   Boolean        movable;       
   Boolean        helpButton;    
   ModalFilterUPP filterProc;     
   StringPtr      defaultText;
   StringPtr      cancelText;    
   StringPtr      otherText;     
   SInt16         defaultButton;
   SInt16         cancelButton;
   UInt16         position;      
};
typedef struct AlertStdAlertParamRec AlertStdAlertParamRec;
typedef AlertStdAlertParamRec *AlertStdAlertParamPtr;

Field Description
movable
A Boolean value indicating whether or not the alert box is movable.
helpButton
A Boolean value indicating whether or not the alert includes a Help button.
filterProc
If the value in the movable field is true (alert is movable), then specify in this parameter a universal procedure pointer to an application-defined filter function that responds to events not handled by ModalDialog. If you do, all events will get routed to your application-defined event filter function for handling, even when your alert box window is in the background. If you set this parameter to nil, the Dialog Manager uses the standard event filter function.
defaultText
Text for button in OK position; see "Alert Default Text Constants". The button automatically sizes and positions itself in the alert box. To specify that the default button names should be used, pass -1. To indicate that no button should be displayed, pass nil.
cancelText
Text for button in Cancel position; see "Alert Default Text Constants". The button automatically sizes and positions itself in the alert box. To specify that the default button names should be used, pass -1. To indicate that no button should be displayed, pass nil.
otherText
Text for button in leftmost position; see "Alert Default Text Constants". The button automatically sizes and positions itself in the alert box. To specify that the default button names should be used, pass -1. To indicate that no button should be displayed, pass nil.
defaultButton
Specifies which button acts as the default button; see "Alert Button Constants".
cancelButton
Specifies which button acts as the Cancel button (can be 0); see "Alert Button Constants".
position
The alert box position, as defined by a window positioning constant; see Macintosh Toolbox Essentials (page 4-126) for a discussion of these constants. In this structure, the constant kWindowDefaultPosition is equivalent to the constant kWindowAlertPositionParentWindowScreen.

Subtopics
Alert Button Constants
Alert Default Text Constants

Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998